package me.ratel.demo.wechat.entities;

import me.ratel.demo.eBook.infrastructure.utils.XmlUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.io.InputStream;

/**
 * @author Administrator
 * @time 2016/8/7 17:24
 */
@XmlRootElement(name = "xml")
public class UnifiedOrderResponse {
    private static final Logger log = LoggerFactory.getLogger(UnifiedOrderResponse.class);

    private String returnCode;

    private String returnMsg;

    private String prepayId;

    public UnifiedOrderResponse() {
    }

    public static UnifiedOrderResponse toBean(InputStream xml) {
        return XmlUtils.toBean(xml, UnifiedOrderResponse.class);
    }

    @XmlElement(name = "return_code")
    @XmlJavaTypeAdapter(value = AdaptorCDATA.class)
    public String getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    @XmlElement(name = "return_msg")
    @XmlJavaTypeAdapter(value = AdaptorCDATA.class)
    public String getReturnMsg() {
        return returnMsg;
    }

    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }

    @XmlElement(name = "prepay_id")
    @XmlJavaTypeAdapter(value = AdaptorCDATA.class)
    public String getPrepayId() {
        return prepayId;
    }

    public void setPrepayId(String prepayId) {
        this.prepayId = prepayId;
    }
}
